package com.woniu.darryringmall.front.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.woniu.darryringmall.front.entity.GoodsSpec;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface GoodsSpecMapper extends BaseMapper<GoodsSpec> {
    @Select("SELECT * FROM mall_goods_spec WHERE JSON_CONTAINS(specvalues,#{specValues}) and goodsid = #{goodsId}")
    GoodsSpec getByJson(@Param("specValues") String specValues, @Param("goodsId") int goodsId);


    @Select("select specvalues from mall_goods_spec where goodsid=#{gid}")
    List<String> getSpecValue(int gid);

}
